﻿app.controller('WalletCtr', function ($scope, service, $filter, ngTableParams) {

    $scope.onQuery = function () {
        $scope.tableParams.page(1);
        $scope.tableParams.reload();
    };

    $scope.init = function () {
        $scope.tableParams = new ngTableParams({
            page: 1,
            count: 10
        }, {
            total: 0,
            getData: function ($defer, params) {

                service.invokeGet('Biking/GetBicycleBaseListByCondition', {
                    BicyCleNumber: $scope.BicycleNumber || '',
                    ProvinceID: $scope.province || 0,
                    PageIndex: params.page() - 1,
                    PageSize: params.count()

                },
                function (result) {

                    if (result.IsSuccess && result.ResObject != null) {
                        data = result.ResObject;
                        params.total(result.total);
                        $defer.resolve(data.List);
                    } else {

                        service.processFailedCode(result.MsgCode, result.Message, '');
                        params.total(0);
                        $defer.resolve([]);
                    }
                });
            }
        });
    };

  

    $scope.init();


});